home *** CD-ROM | disk | FTP | other *** search
- function thegame()
- {
- var _loc1_ = _root;
- if(_loc1_.round >= 12)
- {
- _loc1_.score += 10000;
- gotoAndStop(122);
- }
- clearInterval(thegameID);
- thegameID = setInterval(thegame,20 - _loc1_.round - _loc1_.speedup);
- echeck = 1;
- while(echeck < 6)
- {
- if(_loc1_.player.hitTest("_root.enemys.e" add echeck) && death_c != true)
- {
- clearInterval(thegameID);
- death_c = true;
- tellTarget("_root.player")
- {
- gotoAndStop("death");
- play();
- }
- }
- echeck++;
- }
- if(go_normal > 10 && death_c != true)
- {
- go_normal = 0;
- tellTarget("_root.player.pos")
- {
- gotoAndStop(1);
- }
- }
- if(_loc1_.life < 1)
- {
- clearInterval(thegameID);
- gotoAndStop(119);
- }
- if(Key.isDown(Key.left))
- {
- player.xspeed -= 6;
- }
- if(Key.isDown(Key.right))
- {
- player.xspeed += 6;
- }
- if(Key.isDown(Key.space))
- {
- if(player.jump && death_c != true)
- {
- tellTarget(_loc1_.sounds)
- {
- gotoAndPlay(2);
- }
- player.yspeed -= player.jumpHeight;
- tellTarget("player.pos")
- {
- gotoAndStop(2);
- }
- player.jump = false;
- }
- }
- if(!Key.isDown(Key.down))
- {
- }
- player.xspeed *= 0.5;
- player.yspeed += gravity;
- if(player.yspeed > gravity && death_c != true)
- {
- tellTarget("player.pos")
- {
- gotoAndStop(3);
- }
- }
- if(death_c != true)
- {
- x = player._x + player.xspeed;
- y = player._y + player.yspeed;
- }
- if(bkg.hittest(x,player._y,true))
- {
- player._x = x;
- }
- else
- {
- player.xspeed = 0;
- if(death_c != true)
- {
- tellTarget("_root.player.pos")
- {
- gotoAndStop(1);
- }
- }
- }
- if(bkg.hittest(player._x,y,true))
- {
- player._y = y;
- }
- else
- {
- if(player.yspeed < 0 && death_c != true)
- {
- tellTarget("_root.player.pos")
- {
- gotoAndStop(1);
- }
- }
- else
- {
- if(death_c != true)
- {
- tellTarget("_root.player.pos")
- {
- gotoAndStop(1);
- }
- }
- go_normal += 1;
- player.jump = true;
- }
- player.yspeed = 0;
- }
- }
-